Skip to content

fix: [SDK-4742] remove Capacitor activity lifecycle nudge - #27

Merged
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4742
Jun 3, 2026
Merged

fix: [SDK-4742] remove Capacitor activity lifecycle nudge#27
fadi-george merged 1 commit into
mainfrom
fadi/sdk-4742

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

One Line Summary

Removes the Capacitor Android foreground lifecycle nudge now that lifecycle tracking is handled by the core Android SDK.

Details

Motivation

SDK-4732 moved activity lifecycle observation into the core Android SDK from process start, so Capacitor no longer needs to manually replay activity start/resume callbacks after initialization.

Scope

This removes the Capacitor-only nudgeApplicationServiceForeground() helper and its call from Android initialization. It does not change the public JS API or listener registration behavior.

Testing

Unit testing

  • bun run test

Manual testing

  • bun run lint
  • bun run build
  • ./gradlew :onesignal-capacitor-plugin:compileReleaseKotlin from examples/demo/android
  • Device/manual notification flow testing was not run.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george
fadi-george requested a review from a team June 3, 2026 02:27

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean removal of a now-redundant lifecycle nudge after lifecycle tracking moved into the core Android SDK.

Extended reasoning...

Overview

This PR removes a single Capacitor-only helper, nudgeApplicationServiceForeground(), and its lone call site from OneSignalCapacitorPlugin.initialize(). Two now-unused imports (android.app.Application, IApplicationService) are also dropped. The change is purely subtractive — 17 lines removed, 0 added — in a single Android Kotlin file.

Security risks

None. The change deletes code that synthesized onActivityStarted/onActivityResumed callbacks against the core SDK's application service. It removes a code path rather than introducing one, and touches no auth, crypto, permissions, or data-handling logic.

Level of scrutiny

Low. This is a mechanical deletion driven by an upstream SDK change (SDK-4732) that moved lifecycle observation into the core Android SDK from process start. The behavior the helper was compensating for is now handled before initialize() runs, so the helper is dead weight. Compilation was verified via ./gradlew compileReleaseKotlin and the existing lint/build/test commands.

Other factors

The author noted device-level manual notification flow testing was not run, but the change is a pure removal of redundant code rather than a behavioral addition, and the upstream behavior is owned by the core SDK. No outstanding reviewer comments, no prior bot reviews from me on this PR.

@fadi-george
fadi-george merged commit 66854e2 into main Jun 3, 2026
5 of 6 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-4742 branch June 3, 2026 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant